import request from '@/utils/request'

//登录请求
export function login(user,password){
    return request({
        method: 'post',
        url: '/login?username='+user+'&password='+password,
    })
}



//退出登录
export function logout(){
    return request({
        method: 'post',
        url: '/logout'
    })
}

//通过登录的token来获取用户信息
export function userInfo(){
    return request({
        method: 'get',
        url: '/user/userInfo'
    })
}
//注册用户
export function registerUser(username , password , email){
    return request({
        method: 'post',
        url: '/user/register?username='+username+'&password='+password+'&email='+email
    })
}

export default  { login ,logout,userInfo,registerUser }